package com.three.controller;

import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.net.URLEncoder;

public class test04 {
    public static void main(String[] args) throws UnsupportedEncodingException {


        //将application/x-www-form-urlencoded字符串
        //转换成普通字符串
        //其中的字符串直接从上图所示窗口复制过来
        String keyWord = URLDecoder.decode("%E7%BD%91%E7%BB%9C%E6%97%B6%E7%A9%BA","UTF-8");
        System.out.println(keyWord);
        //将普通字符串转换成
        //application/x-www-form-urlencoded字符串
        String urlStr = URLEncoder.encode("网络时空", "UTF-8");
        System.out.println(urlStr);
    }

}
